<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>无标题文档</title>
	<link href="/res/css/style.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.ext.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="/res/js/jquery.js"></script>
	<script type="text/javascript" src="/res/js/lib/json2.js"></script>	
	<script type="text/javascript" src="/res/js/lib/layer/layer.js"></script>
	<script type="text/javascript" src="/res/js/common/msgTools.js"></script>
 	<script type="text/javascript" src="/res/js/pages/merchant/merchantAskList.js"></script> 
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">商家管理</a></li>
    <li><a href="#">商家申请列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    <form id="queryForm" action="/merchant/ask/list" method="post"> 
    <div class="tools" style="margin:3px 0px;background: #efefef;padding:6px 0px;"> 
    	<ul class="toolbar" style="margin-left:10px;">
	        <li id="btnAdd"><span><img src="/res/images/t01.png" /></span>新增</li>
        </ul>      
	    <span class="toolbar" style="margin-left:50px;">
	                   用户名：<input name="userName" value="${userName}" type="text" class="dfinput" style="width:150px;"/>
	                   手机号：<input name="mobile" value="${mobile}" type="text" class="dfinput" style="width:200px;"/>
		   状态：	
 			   <select class="dfinput"  name="status" style="width:150px;" onchange="submit()">
 			    <option value="-1">===全部===</option>
				<option value="0" ${status==0?"selected":""}>待审核</option>
				<option value="2" ${status==2?"selected":""}>未通过</option>
			   </select> 	                   
	    </span> 
    	<ul class="toolbar" style="margin-left:20px;">
	        <li onclick="$('#queryForm').submit()"><span><img src="/res/images/ico06.png" /></span>搜索</li>
        </ul>    
    </div>
    </form>

    <form id="listForm" action="/merchant/ask/list" method="post"> 
    <table class="tablelist">
    	<thead>
	    	<tr>
	        <th align="center" class="chk"><input id="chkAll" type="checkbox" value="" /></th>
	        <th width="36">编号</th>
	        <th width="100">商户图片</th>
			<th>商户名称</th>
			<th>用户名</th>
			<th>省份</th>
			<th>城市</th>
			<th>地区</th>	
			<th>经营项目</th>
			<th>申请状态</th> 
			<th>拒绝理由</th>
			<th>申请时间</th>
			<th>操作</th>   
	        </tr>
        </thead>
        <tbody>        
	        <c:forEach items="${list}" var="row" varStatus="status">
 		        <tr>
		        <td align="center"><input id="chk_${row.id}" type="checkbox" value="${row.id}" /></td>
		        <td>${status.index+1}</td>
		        <td>
		            <a href='${!empty(row.img_cover)?row.img_cover:!empty(row.img_cover_small)?row.img_cover_small:"/res/images/nopic2.png"}' target="_blank">
                      <img src='${!empty(row.img_cover_small)?row.img_cover_small:!empty(row.img_cover)?row.img_cover:"/res/images/nopic2.png"}' width="90" height="50"/>
                    </a>
                </td>
		        <td>${row.merchant_name}<br/>
		                             详细地址:${row.address}
		        </td>		        
		        <td><a href="javascript:viewUser(${row.userid})" class="tablelink">${row.user_name}</a><br/>
		        	商户电话:${row.mobile}
		        </td>
		        <td>${row.province_name}</td>
		        <td>${row.city_name}</td>
		        <td>${row.area_name}</td>
		        <td>${row.category_name}</td>	  
		        <td>${ (!empty(row.status) &&row.status==0?"待审核":(row.status==1?"通过审核":(row.status==2?"<span class='red'>未通过审核</span>":"")))}</td>
		        <td>${fn:substring(row.audit_msg,0,20)}${fn:length(row.audit_msg)>20?"...":""}</td>	
		        <td>
		            <a class="tablelink" href="javascript:viewMerchantImg('${row.id}')">展示照</a><br/>
		            <fmt:formatDate value="${row.create_time}" pattern="yyyy-MM-dd HH:mm"/>
		        </td>	
		        <td>
		           <a href="javascript:edit('${row.id}')" class="tablelink">编辑</a>	
		           <a href="javascript:pass('${row.id}')" class="tablelink">通过</a>		           
		           <a href="javascript:refuseDlg('${row.id}')" class="tablelink">不通过</a>
		        </td>	
		        </tr>  
	        </c:forEach>
         </tbody>
    </table>   
    </form>
      
    <tags:pager pagerRange="10" pageSize="${pager.pageSize}" totalPage="${pager.pageCount}" curIndex="${pager.pageIndex}" rowCount="${pager.rowCount}" formId="queryForm"></tags:pager> 
 
    
    </div>
    
    <script type="text/javascript">
	   $('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
